<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    <style>
        div.container {
            width: 30em;
            /*border:1em solid;*/
        }

        div.box {
            box-sizing: border-box;
            -moz-box-sizing: border-box; /* Firefox */
            width: 50%;
            border: 1em solid red;
            float: left;
        }
    </style>
</head>
<body>

<div class="container">
    <div class="box">这个 div 占据了左边的一半。</div>
    <div class="box">这个 div 占据了右边的一半。</div>
</div>

</body>
</html>ml>